namespace Crux.Core.Dapper;
/// <summary>
/// 
/// </summary>
/// <typeparam name="TContext"></typeparam>
public interface IDbContextFactory<out TContext>
    where TContext : DapperContext
{
    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    TContext CreateDbContext();
    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns> 
    TContext CreateDbContext(Func<DbConnection> factory);
    /// <summary>
    /// 
    /// </summary>
    /// <param name="factory"></param>
    /// <returns></returns>
    IUnitOfWork<TContext> GetUnitOfWork(Func<DbConnection> factory);
    /// <summary>
    /// 
    /// </summary>
    /// <param name="factory"></param>
    /// <returns></returns>
    IQueryRepository<TContext> GetQueryRepository(Func<DbConnection> factory);
}